FIND_PACKAGE(PAM REQUIRED)

SET(CMAKE_SKIP_BUILD_RPATH  TRUE)
SET(CMAKE_INSTALL_RPATH "")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)

ADD_EXECUTABLE(veyon-auth-helper ${CMAKE_CURRENT_SOURCE_DIR}/VeyonAuthHelper.cpp)

SET_DEFAULT_TARGET_PROPERTIES(veyon-auth-helper)

TARGET_COMPILE_OPTIONS(veyon-auth-helper PRIVATE ${VEYON_COMPILE_OPTIONS})
TARGET_INCLUDE_DIRECTORIES(veyon-auth-helper PRIVATE ${PAM_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(veyon-auth-helper Qt5::Core ${PAM_LIBRARY})

INSTALL(TARGETS veyon-auth-helper RUNTIME DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE SETUID GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
